﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TeamNitro.App_Code;

namespace TeamNitro
{
    public partial class AdminAddSubjElective : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnAdminCreate_Click(object sender, EventArgs e)
        {
            DBManager_Rex db = new DBManager_Rex();
            db.ElectiveCode = tbxElectiveCode.Text;
            db.ElectiveName = tbxElectiveName.Text;
            db.CourseCode = tbxCourseCode.Text;
            db.CourseName = tbxCourseName.Text;
            db.CU = 4;

            bool flag = DBManager_Rex.AddElectiveSubject(db);

            if (flag == true)
            {
                lblResult.Text = "CDS added successfully";
            }
            else
            {
                lblResult.Text = "Unable to add CDS";
            }

            lblResult.Visible = true;
        }
    }
}